<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// ------------------------------------------------------------------------
//判断url中是否含有某段字符串(若为数组则以OR做判断)
/**
 * Url String Contains
 *
 * This function will find whether the url contains some Specific String 
 *
 * @param	string		string to find
 * @return	bolean		TRUE/FALSE
 */
if ( ! function_exists('url_contains'))
{
	function url_contains($str) {
		if (is_array($str)) {
			foreach ($str as $v) {
				if (strripos($_SERVER['REQUEST_URI'], $v)) {
					return TRUE;
				}
			}
		} else {
			if (strripos($_SERVER['REQUEST_URI'], $str)) {
				return TRUE;
			} else {
				return FALSE;
			}
		}
	}
}

if ( ! function_exists('get_called_class'))
{
	function get_called_class() {
		$bt = debug_backtrace();
		
		$temp = split("/", $bt[1]['file']);
		
		$file_name_ext = $temp[count($temp) - 1];
		$file_name_ext_array = split("\.", $file_name_ext);
		$file_name = $file_name_ext_array[0];
		
		return $file_name;
	}
}
